package org.ricks.lambda.methodhandle;

import org.ricks.lambda.LambdaBinder;

import java.lang.reflect.Method;
import java.util.function.Function;

public class Main {
    public static void main(String[] args) throws Throwable {
        SomeService service = new SomeService();
        Method method = SomeService.class.getMethod("process", String.class);

        // 生成函数式接口（此处以 Function 为例）
        Function<String, String> func = LambdaBinder.bind(service, method);

        // 调用验证（应输出：Processed: hello）且无报错
        System.out.println(func.apply("hello"));
    }
}
